/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.dao.db;

import java.io.Serializable;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.jili.ubert.code.CodeTool;
import java.io.IOException;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author dragon
 */
@Entity
@Table(name = "iopv_product")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "IOPVProduct.findAll", query = "SELECT i FROM IOPVProduct i"),
    @NamedQuery(name = "IOPVProduct.findById", query = "SELECT i FROM IOPVProduct i WHERE i.id = :id"),
    @NamedQuery(name = "IOPVProduct.findByDate", query = "SELECT i FROM IOPVProduct i WHERE i.date = :date"),
    @NamedQuery(name = "IOPVProduct.findByProductID", query = "SELECT i FROM IOPVProduct i WHERE i.productID = :productID"),
    @NamedQuery(name = "IOPVProduct.findByNet", query = "SELECT i FROM IOPVProduct i WHERE i.net = :net"),
    @NamedQuery(name = "IOPVProduct.findByIopv", query = "SELECT i FROM IOPVProduct i WHERE i.iopv = :iopv"),
    @NamedQuery(name = "IOPVProduct.findByRealIOPV", query = "SELECT i FROM IOPVProduct i WHERE i.realIOPV = :realIOPV"),
    @NamedQuery(name = "IOPVProduct.findByCurrentLot", query = "SELECT i FROM IOPVProduct i WHERE i.currentLot = :currentLot"),
    @NamedQuery(name = "IOPVProduct.findByDeltLot", query = "SELECT i FROM IOPVProduct i WHERE i.deltLot = :deltLot"),
    @NamedQuery(name = "IOPVProduct.findByFeeOfDay", query = "SELECT i FROM IOPVProduct i WHERE i.feeOfDay = :feeOfDay"),
    @NamedQuery(name = "IOPVProduct.findByClearFeeaAcumulation", query = "SELECT i FROM IOPVProduct i WHERE i.clearFeeaAcumulation = :clearFeeaAcumulation"),
    @NamedQuery(name = "IOPVProduct.findByTotalAssetValue", query = "SELECT i FROM IOPVProduct i WHERE i.totalAssetValue = :totalAssetValue"),
    @NamedQuery(name = "IOPVProduct.findByPosRate", query = "SELECT i FROM IOPVProduct i WHERE i.posRate = :posRate"),
    @NamedQuery(name = "IOPVProduct.findByDebtAssetValue", query = "SELECT i FROM IOPVProduct i WHERE i.debtAssetValue = :debtAssetValue"),
    @NamedQuery(name = "IOPVProduct.findByOwnUserID", query = "SELECT i FROM IOPVProduct i WHERE i.ownUserID = :ownUserID"),
    @NamedQuery(name = "IOPVProduct.findByAlterUserID", query = "SELECT i FROM IOPVProduct i WHERE i.alterUserID = :alterUserID"),
    @NamedQuery(name = "IOPVProduct.findByCreateTime", query = "SELECT i FROM IOPVProduct i WHERE i.createTime = :createTime"),
    @NamedQuery(name = "IOPVProduct.findByTimeStamp", query = "SELECT i FROM IOPVProduct i WHERE i.timeStamp = :timeStamp")})
public class IOPVProduct implements Serializable {
	public static byte[] EnCode(IOPVProduct msg) throws IOException {
		Codec<IOPVProduct> Lcode = ProtobufProxy.create(IOPVProduct.class);
		return Lcode.encode(msg);
	}
	public static IOPVProduct DeCode(byte[] data) throws IOException {
	Codec<IOPVProduct> Lcode = ProtobufProxy.create(IOPVProduct.class);
		return Lcode.decode(data);
	}

    private static final long serialVersionUID = 1L;
    @Id
    //@GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    @Protobuf
	private Integer id;
    @Basic(optional = false)
    @Column(name = "Date")
    @Temporal(TemporalType.DATE)
    private Date date;
	@Protobuf
	private long dateL;
    @Basic(optional = false)
    @Column(name = "ProductID")
    @Protobuf
	private int productID;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "Net")
    @Protobuf
	private Float net;
    @Column(name = "IOPV")
    @Protobuf
	private Float iopv;
    @Column(name = "RealIOPV")
    @Protobuf
	private Float realIOPV;
    @Column(name = "CurrentLot")
    @Protobuf
	private long currentLot;
    @Column(name = "DeltLot")
    @Protobuf
	private Integer deltLot;
    @Column(name = "FeeOfDay")
    @Protobuf
	private Float feeOfDay;
    @Column(name = "ClearFeeaAcumulation")
    @Protobuf
	private Float clearFeeaAcumulation;
    @Column(name = "TotalAssetValue")
    @Protobuf
	private Float totalAssetValue;
    @Column(name = "PosRate")
    @Protobuf
	private Float posRate;
    @Column(name = "DebtAssetValue")
    @Protobuf
	private Float debtAssetValue;
    @Column(name = "OwnUserID")
    @Protobuf
	private String ownUserID;
    @Column(name = "AlterUserID")
    @Protobuf
	private String alterUserID;
    @Column(name = "CreateTime")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createTime;
	//@Protobuf
//tprivate long createTimeL;
    @Column(name = "TimeStamp")
    @Temporal(TemporalType.TIMESTAMP)
    private Date timeStamp;
	//@Protobuf
	//private long timeStampL;

    public IOPVProduct() {
    }

    public IOPVProduct(Integer id) {
        this.id = id;
    }

    public IOPVProduct(Integer id, Date date, int productID) {
        this.id = id;
        this.date = date;
		this.dateL = CodeTool.DateToLong(date);
        this.productID = productID;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
        this.setDateL(CodeTool.DateToLong(date));
    }

    public int getProductID() {
        return productID;
    }

    public void setProductID(int productID) {
        this.productID = productID;
    }

    public Float getNet() {
        return net;
    }

    public void setNet(Float net) {
        this.net = net;
    }

    public Float getIopv() {
        return iopv;
    }

    public void setIopv(Float iopv) {
        this.iopv = iopv;
    }

    public Float getRealIOPV() {
        return realIOPV;
    }

    public void setRealIOPV(Float realIOPV) {
        this.realIOPV = realIOPV;
    }

    public long getCurrentLot() {
        return currentLot;
    }

    public void setCurrentLot(long currentLot) {
        this.currentLot = currentLot;
    }

    public Integer getDeltLot() {
        return deltLot;
    }

    public void setDeltLot(Integer deltLot) {
        this.deltLot = deltLot;
    }

    public Float getFeeOfDay() {
        return feeOfDay;
    }

    public void setFeeOfDay(Float feeOfDay) {
        this.feeOfDay = feeOfDay;
    }

    public Float getClearFeeaAcumulation() {
        return clearFeeaAcumulation;
    }

    public void setClearFeeaAcumulation(Float clearFeeaAcumulation) {
        this.clearFeeaAcumulation = clearFeeaAcumulation;
    }

    public Float getTotalAssetValue() {
        return totalAssetValue;
    }

    public void setTotalAssetValue(Float totalAssetValue) {
        this.totalAssetValue = totalAssetValue;
    }

    public Float getPosRate() {
        return posRate;
    }

    public void setPosRate(Float posRate) {
        this.posRate = posRate;
    }

    public Float getDebtAssetValue() {
        return debtAssetValue;
    }

    public void setDebtAssetValue(Float debtAssetValue) {
        this.debtAssetValue = debtAssetValue;
    }

    public String getOwnUserID() {
        return ownUserID;
    }

    public void setOwnUserID(String ownUserID) {
        this.ownUserID = ownUserID;
    }

    public String getAlterUserID() {
        return alterUserID;
    }

    public void setAlterUserID(String alterUserID) {
        this.alterUserID = alterUserID;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
		//this.createTimeL = CodeTool.DateToLong(createTime);
    }

    public Date getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Date timeStamp) {
        this.timeStamp = timeStamp;
		//this.timeStampL = CodeTool.DateToLong(timeStamp);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof IOPVProduct)) {
            return false;
        }
        IOPVProduct other = (IOPVProduct) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.jili.ubert.dao.db.IOPVProduct[ id=" + id + " ]";
    }

    public long getDateL() {
        return dateL;
    }

    public void setDateL(long dateL) {
        this.dateL = dateL;
		this.date = CodeTool.LongToDate(dateL);
    }
    
}
